cmake_minimum_required(VERSION 3.12)
project(AIKA_SEH_WuBi VERSION 1.0.0)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 查找Python和pybind11
find_package(Python COMPONENTS Interpreter Development REQUIRED)
find_package(pybind11 REQUIRED)

# 包含目录
include_directories(src)

# 源文件
set(SOURCES
    src/symbols/wubi/wubi_symbol.cpp
    src/symbols/radicals/radical_semantic.cpp
    src/core/semantic_engine/semantic_reasoner.cpp
    src/core/evolution/autonomous_learner.cpp
    src/knowledge/evolution/knowledge_evolver.cpp
    src/interface/python_bindings.cpp
)

# 创建核心库
add_library(aika_seh_wubi_core STATIC
    src/symbols/wubi/wubi_symbol.cpp
    src/symbols/radicals/radical_semantic.cpp
    src/core/semantic_engine/semantic_reasoner.cpp
    src/core/evolution/autonomous_learner.cpp
    src/knowledge/evolution/knowledge_evolver.cpp
)

target_include_directories(aika_seh_wubi_core PUBLIC src)
target_compile_features(aika_seh_wubi_core PUBLIC cxx_std_17)

# 创建Python绑定模块
pybind11_add_module(aika_seh_wubi ${SOURCES})

# 链接核心库
target_link_libraries(aika_seh_wubi PRIVATE aika_seh_wubi_core)

# 安装目标
install(TARGETS aika_seh_wubi DESTINATION .)
install(TARGETS aika_seh_wubi_core DESTINATION lib)
install(DIRECTORY src/ DESTINATION include/aika_seh_wubi FILES_MATCHING PATTERN "*.h")